package main

import (
	"flag"
	"fmt"
	"os"
)

func main() {

	username := flag.String("username", "admin", "username")
	password := flag.String("password", "admin123", "password")
	flag.Parse()
	// 命令行执行时候 `./flag --username admin --password admin123`
	// 一个`-`或者两个`-`都是可以的

	fmt.Println("os args is: ", os.Args)
	fmt.Printf("username is [%s]:\n", *username)
	fmt.Printf("password is [%s]:\n", *password)
}
